#include "OperatorDivide.h"

#include <iostream>

OperatorDivide::OperatorDivide()
{
    //ctor
}

OperatorDivide::~OperatorDivide()
{
    //dtor
}

double OperatorDivide::exec(double a, double b) const
{
    if ( b == 0. )
    {
        std::cerr << "Warning: zero division" << std::endl;
        return 0.;
    }

    return a / b;
}

std::string OperatorDivide::str() const
{
    return "/";
}
